Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: state management for creators #179

Merged
merged 8 commits into from
Jun 25, 2024
Merged

Conversation

lauti7
Copy link
Contributor

@lauti7 lauti7 commented Jun 18, 2024

This PR:

  • adds endpoints for creators to handle Quest Instances state
  • fixes db error namings
  • fixes paginated endpoints to return the total items

Copy link
Contributor

@aleortega aleortega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +44 to +47
log::error!(
"error on checking if {address} is quest creator of {}",
instance.quest_id
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we log this error? seems a business validation and may can cause flood on logs in we get attacked

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we return Unauthorized on this case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe return HttpResponse::from_error(QuestError::NotQuestCreator)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HttpResponse::from_error(QuestError::NotQuestCreator) is already considered in the first Ok() branch. The function returns an error when the DB fails, not when there is a mismatch.

@lauti7 lauti7 merged commit b039370 into main Jun 25, 2024
3 checks passed
@lauti7 lauti7 deleted the feat/state-management-for-creators branch June 25, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants